package chapter23.homework02;

public class Primary extends State{
    public Primary(Player player){
            //玩家的初始状态
            this.rankName = "入门级";
            this.player = player;
            point = 0;
    }

    public Primary(State state){
        //玩家的初始积分为0
        this.rankName = "新手";
        this.player  =  state.player;
        point = state .point;
    }
    @Override
    public void checkState(int point) {
        if(point >= 30){
            player.setState(new Secondary(this));//将过关后的状态进行传入下一级
        }
    }
}
